Add GPT-5 support (OpenAI API parameters)” #1883
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Responding to issue #1880 GPT-5 not supported max_tokens must be max_completion_tokens.
Add GPT-5 support to token accounting and limits (costs, max context, token counting).
Treat GPT-5 as multimodal in model capability checks.
Expose GPT-5 in SPO app model pickers (optimization/evaluation/execution).
Mention GPT-5 in README and example config comments.
Preserve existing model behavior and defaults.
Feature Docs
README and config2.example.yaml comments updated to include “gpt-5”.
No additional RFC/tutorial required; feature is additive.
Influence
Cost tracking now includes GPT-5 with placeholder pricing (mirrors GPT‑4o); update when official rates are available.
Token counting recognizes GPT-5 to avoid NotImplementedError; falls back to cl100k_base if tiktoken lacks mapping.
GPT-5 assumed multimodal; if that’s inaccurate, remove from MULTI_MODAL_MODELS with no broader impact.
UI gains GPT-5 options; no change to defaults.
Result
No tests were run in this change. Functionality is additive and non-breaking; happy to run tests on request.
Other
Update TOKEN_COSTS and TOKEN_MAX when official GPT‑5 pricing/context limits are announced.
If desired, constrain multimodal to only confirmed GPT‑5 variants or add versioned aliases (e.g., gpt-5-turbo).